<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String url = request.getScheme() + "://" + request.getServerName()
			+ request.getRequestURI();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />
		<title>权限管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<%@ include file="/html/custom/header.jsp"%>

		<link type="text/css" href="<%=basePath%>/html/css/gm/popedom.css"
			rel="stylesheet" />

		<script type="text/javascript"
			src="<%=basePath%>html/js/swss.popedom.js"></script>
		<style>
			.datagird span{width: 100px;}
			.datagird th a{display: inline; vertical-align: middle; }
			.datagird span a{border: 1px solid #ffffff; vertical-align: middle; }
			.sub-box{border: 1px solid #cecece; float: left; position: relative; margin: 27px 10px 0 0; background-color: white; }
			.datagird .sub-title{ width:100px; margin:0; position: absolute; top: -20px; left:5px;background-color: white; border: 1px solid #cecece; border-bottom: 0; padding: 2px 5px;}
			.datagird .sub-title  a{border: 0; padding: 0 5px; border: 1px solid white;white-space:nowrap; }
			.p-list{padding: 3px;}
		</style>
	</head>

	<body>
		<!-- 导航 -->
		<s:action name="showTopNav" executeResult="true" namespace="/user"></s:action> 
	
		<%@ include file="/html/custom/formDel.jsp"%>
		

		<div id="content">
			<div class="toolbar">
				<span id="btnset" class="btnset"> <a id="btnAddData"
					href="#">新增权限</a><a id="btnDelPopedom" href="#">删除权限</a> </span>
			</div>
			
			<div class="datagird">
				<s:form id="formDelPope" namespace="/user" action="popedom_delAll">

					<table class="ui-widget ui-widget-content">
						<thead>
							
						</thead>
						<tbody>
							<s:iterator value="#request.popeList" id="mod" >
								<s:if test="type==1" >
								<tr class="ui-widget-header ">
									<th>
										<label>
										<input name="popedomIds" type="checkbox" value="<s:property value="#mod.id" />" data-type="<s:property value="#mod.type" />"  /> 	
										</label>				
										<a id="btnModPope_<s:property value="id" />" title="<s:property value="description" />" href="#" ><s:property value="queue" />_<s:property value="popedomName" /></a>

									</th>

								</tr>
								<tr>
									<td id="box_<s:property value="#mod.id" />" >
										<s:iterator value="#request.popeList" id="sub" >
											<s:if test="(#sub.type==2)&&(#sub.parent==#mod.id)" >
												<div class="sub-box" >
													<span class="sub-title" >
														<label>
														<input name="popedomIds" type="checkbox" value="<s:property value="#sub.id" />" data-type="<s:property value="#sub.type" />" /> 
														</label>
														<a title="<s:property value="#sub.description" />"  id="btnModPope_<s:property value="#sub.id" />_0_<s:property value="#mod.id" />" href="#">(<s:property value="#sub.queue" />)<s:property value="#sub.popedomName" /></a>
														
													</span>
													<div  class="p-list" id="box_<s:property value="#sub.id" />" >
														<s:iterator value="#request.popeList" id="pope" >
															<s:if test="(#pope.type==3)&&(#pope.parent==#sub.id)">
																<span >
																	<label>
																	<input name="popedomIds" type="checkbox" value="<s:property value="#pope.id" />" /> 
																	</label>
																	<a title="<s:property value="#pope.description" />"  id="btnModPope_<s:property value="#pope.id" />_<s:property value="#sub.id" />_<s:property value="#mod.id" />" href="#"><s:property value="#pope.queue" />.<s:property value="#pope.popedomName" /></a>
																	
																</span>
															</s:if>
														</s:iterator>
													</div>
												</div>
											</s:if>
										</s:iterator>
									
									</td>
								</tr>
								</s:if>
							</s:iterator>


						</tbody>
					</table>
				</s:form>
			</div>

		</div>


		<div id="dialogAddData" style="display: none;">
			<s:form id="formData" namespace="/user" action="popedom_add">
				<fieldset>
					<input type="hidden" name="popedom.id" id="dataId" />
					<label for="name">
						所属模块
					</label>
					<select name="popedom.moduleId" id="selModuleId">
						<s:iterator value="#request.modList">
							<option value="<s:property value="id" />">
								<s:property value="name" />
							</option>
						</s:iterator>
					</select>
					<label >
						权限名称
					</label>
					<input type="text" name="popedom.popedomName" id="txtPopedomName"
						value="" class="text ui-widget-content ui-corner-all" />
					<label >
						URL
					</label>
					<input type="text" name="popedom.url" 
						value="" class="text ui-widget-content ui-corner-all" />
					<label for="password">
						权限描述
					</label>
					<textarea name="popedom.description" id="txtDescription" rows="4"
						cols=""></textarea>

				</fieldset>
			</s:form>
		</div>
		<%@ include file="/html/custom/footer.jsp"%>
	</body>
</html>
